#include <stdio.h>
#include <stdlib.h>
#include "argv.h"//该函数库中包括freemakeargv.c及makeargv.c函数的调用

int main(int argc, char *argv[]) 
{
   char delim[] = " \t";//制表符
   int i;
   char **myargv;//见下方解释
   int numtokens;

   if (argc != 2)//如果输入的命令字符个数不等于2，就输出标准错误 
   {
        fprintf(stderr, "Usage: %s string\n", argv[0]);
        return 1;
   }   
  if ((numtokens = makeargv(argv[1], delim, &myargv)) == -1) 
  {
        fprintf(stderr, "Failed to construct an argument array for %s\n", argv[1]);//意思是无法构造一个参数数组
        return 1;
   } 
   printf("The argument array contains:\n");
   for (i = 0; i < numtokens; i++)
        printf("%d:%s\n", i, myargv[i]);
   execvp(myargv[0], myargv);

   return 0;
}